home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / misc / pdflib / bind / vb / pdflib_vb.idl < prev    next >
Text File  |  1999-12-06  |  16KB  |  291 lines

  1. /*---------------------------------------------------------------------------*
  2.  |        PDFlib - A library for dynamically generating PDF files            |
  3.  +---------------------------------------------------------------------------+
  4.  |        Copyright (c) 1997-1999 Thomas Merz. All rights reserved.          |
  5.  +---------------------------------------------------------------------------+
  6.  |    This software is not in the public domain.  It is subject to the       |
  7.  |    "Aladdin Free Public License".  See the file license.txt for details.  |
  8.  |    This license grants you the right to use and redistribute PDFlib       |
  9.  |    under certain conditions. Among other things, the license requires     |
  10.  |    that the copyright notice and this notice be preserved on all copies.  |
  11.  |    This requirement extends to ports to other programming languages.      |
  12.  |                                                                           |
  13.  |    In short, you are allowed to develop and use PDFlib-based software     |
  14.  |    as long as you don't sell it. Commercial use of PDFlib requires a      |
  15.  |    commercial license which can be obtained from the author of PDFlib.    |
  16.  |    Contact information can be found in the accompanying PDFlib manual.    |
  17.  |    PDFlib is distributed with no warranty of any kind. Commercial users,  |
  18.  |    however, will receive warranty and support statements in writing.      |
  19.  *---------------------------------------------------------------------------*/
  20.  
  21. // pdflib.idl
  22. //
  23. // IDL file for the PDFlib type library pdflib.tlb
  24. //
  25.  
  26. [    uuid(17A5ABE0-473D-11d3-95D3-0010A4004174),    // our unique UID
  27.     helpstring("PDFlib 2.01 Type library by Thomas Merz"),
  28.     lcid (0x00000000),                // language 0 = neutral
  29.     version(2.01)
  30. ]
  31.  
  32. library PDFlib {            // library name
  33.  
  34. [ dllname("pdflib_vb.dll") ]
  35.  
  36. module PDFlib {                // class name
  37.  
  38.  
  39. [entry("PDF_boot"), helpstring("Boot PDFlib (currently not required)"),]
  40. void PDF_boot(void);
  41.  
  42. [entry("PDF_shutdown"), helpstring("Shut down PDFlib (currently not required)"),]
  43. void PDF_shutdown(void);
  44.  
  45. [entry("PDF_get_opaque"), helpstring("Fetch opaque application pointer stored in PDFlib"),]
  46. void *PDF_get_opaque([in] long p);
  47.  
  48. [entry("PDF_new2"), helpstring("Create new PDF object, optionally supplying error handler and memory allocation routines"),]
  49. long PDF_new2([in] long errorhandler, [in] long allocproc, [in] long reallocproc, [in] long freeproc, [in] long opaque);
  50. //long PDF_new2([in] void (*errorhandler)(long p, int type, LPCSTR msg), [in] long allocproc, [in] long reallocproc, [in] long freeproc, [in] long opaque);
  51.  
  52. [entry("PDF_new"), helpstring("Create a new PDF object"),]
  53. long PDF_new(void);
  54.  
  55. [entry("PDF_delete"), helpstring("Delete a PDF object"),]
  56. void PDF_delete([in] long p);
  57.  
  58. [entry("PDF_open_file"), helpstring("Open a new PDF file associated with p, using the supplied file name"),]
  59. int PDF_open_file([in] long p, [in] LPCSTR filename);
  60.  
  61. [entry("PDF_close"), helpstring("Close the generated PDF file"),]
  62. void PDF_close([in] long p);
  63.  
  64. [entry("PDF_begin_page"), helpstring("Start a new page"),]
  65. void PDF_begin_page([in] long p, [in] float width, [in] float height);
  66.  
  67. [entry("PDF_end_page"), helpstring("Finish the page"),]
  68. void PDF_end_page([in] long p);
  69.  
  70. [entry("PDF_set_transition"), helpstring("Set a transition effect for the current page"),]
  71. void PDF_set_transition([in] long p, [in] LPCSTR type);
  72.  
  73. [entry("PDF_set_duration"), helpstring("Set the duration for a page transition effect"),]
  74. void PDF_set_duration([in] long p, [in] float t);
  75.  
  76. [entry("PDF_set_parameter"), helpstring(""),]
  77. void PDF_set_parameter([in] long p, [in] LPCSTR key, [in] LPCSTR value);
  78.  
  79. [entry("PDF_show"), helpstring("Print text in the current font at the current position"),]
  80. void PDF_show([in] long p, [in] LPCSTR text);
  81.  
  82. [entry("PDF_show_xy"), helpstring("Print text in the current font at (x, y)"),]
  83. void PDF_show_xy([in] long p, [in] LPCSTR text, [in] float x, [in] float y);
  84.  
  85. [entry("PDF_continue_text"), helpstring("Print text at the next line"),]
  86. void PDF_continue_text([in] long p, [in] LPCSTR text);
  87.  
  88. [entry("PDF_set_leading"), helpstring("Set the distance between text baselines"),]
  89. void PDF_set_leading([in] long p, [in] float l);
  90.  
  91. [entry("PDF_set_text_rise"), helpstring("Set the text rise parameter"),]
  92. void PDF_set_text_rise([in] long p, [in] float rise);
  93.  
  94. [entry("PDF_set_horiz_scaling"), helpstring("Set horizontal text scaling in percent"),]
  95. void PDF_set_horiz_scaling([in] long p, [in] float scale);
  96.  
  97. [entry("PDF_set_text_rendering"), helpstring("Set text rendering mode"),]
  98. void PDF_set_text_rendering([in] long p, [in] int mode);
  99.  
  100. [entry("PDF_set_text_matrix"), helpstring("Set a transformation matrix to be applied to the current font"),]
  101. void PDF_set_text_matrix([in] long p, [in] float a, [in] float b, [in] float c, [in] float d, [in] float e, [in] float f);
  102.  
  103. [entry("PDF_set_text_pos"), helpstring("Set the text output position to (x, y)"),]
  104. void PDF_set_text_pos([in] long p, [in] float x, [in] float y);
  105.  
  106. [entry("PDF_set_char_spacing"), helpstring("Set the horizontal character spacing in text space units"),]
  107. void PDF_set_char_spacing([in] long p, [in] float spacing);
  108.  
  109. [entry("PDF_set_word_spacing"), helpstring("Set the horizontal word spacing in text space units"),]
  110. void PDF_set_word_spacing([in] long p, [in] float spacing);
  111.  
  112. [entry("PDF_get_fontname"), helpstring("Return the name of the current font"),]
  113. LPCSTR PDF_get_fontname([in] long p);
  114.  
  115. [entry("PDF_get_fontsize"), helpstring("Return the size of the current font"),]
  116. float PDF_get_fontsize([in] long p);
  117.  
  118. [entry("PDF_get_font"), helpstring("Return the identifier of the current font"),]
  119. int PDF_get_font([in] long p);
  120.  
  121. [entry("PDF_stringwidth"), helpstring("Return the width of text in an arbitrary font which has been selected with PDF_findfont()"),]
  122. float PDF_stringwidth([in] long p, [in] LPCSTR text, [in] int font, [in] float size);
  123.  
  124. [entry("PDF_findfont"), helpstring("Prepare a font for later use with PDF_setfont(). The metrics will be loaded, and if embed is nonzero, the font file will be checked (but not yet used)."),]
  125. int PDF_findfont([in] long p, [in] LPCSTR fontname, [in] LPCSTR encoding, [in] int embed);
  126.  
  127. [entry("PDF_setfont"), helpstring("Set the current font in the give size. The font descriptor must have been retrieved via PDF_findfont()"),]
  128. void PDF_setfont([in] long p, [in] int font, [in] float fontsize);
  129.  
  130. [entry("PDF_save"),    helpstring("Save the current graphics state"),]
  131. long PDF_save ([in] long p);
  132.  
  133. [entry("PDF_restore"),    helpstring("Restore the most recently saved graphics state"),]
  134. long PDF_restore ([in] long p);
  135.  
  136. [entry("PDF_translate"), helpstring("Translate the origin of the coordinate system to (tx, ty)"),]
  137. long PDF_translate ([in] long p, [in] float tx, [in] float ty);
  138.  
  139. [entry("PDF_scale"), helpstring("Scale the coordinate system by (sx, sy)"),]
  140. void PDF_scale([in] long p, [in] float sx, [in] float sy);
  141.  
  142. [entry("PDF_rotate"), helpstring("Rotate the coordinate system by phi degrees"),]
  143. long PDF_rotate ([in] long p, [in] float phi);
  144.  
  145. [entry("PDF_setdash"), helpstring("Set the current dash pattern to d1 white and d2 black units"),]
  146. void PDF_setdash([in] long p, [in] float d1, [in] float d2);
  147.  
  148. [entry("PDF_setpolydash"), helpstring("Set a more complicated dash pattern defined by an array"),]
  149. void PDF_setpolydash([in] long p, [in] float *darray, [in] int length);
  150.  
  151. [entry("PDF_setflat"), helpstring("Set the flatness to a value between 0 and 100 inclusive"),]
  152. void PDF_setflat([in] long p, [in] float flat);
  153.  
  154. [entry("PDF_set_fillrule"), helpstring("Set the current fill rule to winding or evenodd"),]
  155. void PDF_set_fillrule([in] long p, [in] LPCSTR *fillrule);
  156.  
  157. [entry("PDF_setlinejoin"), helpstring("Set the line join parameter to a value between 0 and 2 inclusive"),]
  158. void PDF_setlinejoin([in] long p, [in] float join);
  159.  
  160. [entry("PDF_setlinecap"), helpstring("Set the linecap parameter to a value between 0 and 2 inclusive"),]
  161. void PDF_setlinecap([in] long p, [in] float cap);
  162.  
  163. [entry("PDF_setmiterlimit"), helpstring("Set the miter limit to a value greater than or equal to 1"),]
  164. void PDF_setmiterlimit([in] long p, [in] float miter);
  165.  
  166. [entry("PDF_setlinewidth"), helpstring("Set the current linewidth to width"),]
  167. void PDF_setlinewidth([in] long p, [in] float width);
  168.  
  169. [entry("PDF_moveto"), helpstring("Set the current point to (x, y)"),]
  170. long PDF_moveto ([in] long p, [in] float x, [in] float y);
  171.  
  172. [entry("PDF_lineto"), helpstring("Draw a line from the current point to (x, y)"),]
  173. long PDF_lineto ([in] long p, [in] float x, [in] float y);
  174.  
  175. [entry("PDF_curveto"), helpstring("Draw a Bezier curve from the current point, using 3 more control points"),]
  176. void PDF_curveto([in] long p, [in] float x1, [in] float y1, [in] float x2, [in] float y2, [in] float x3, [in] float y3);
  177.  
  178. [entry("PDF_circle"), helpstring("Draw a circle with center (x, y) and radius r"),]
  179. void PDF_circle([in] long p, [in] float x, [in] float y, [in] float r);
  180.  
  181. [entry("PDF_arc"), helpstring("Draw a circular arc with center (x, y), radius r from alpha1 to alpha2"),]
  182. void PDF_arc([in] long p, [in] float x, [in] float y, [in] float r, [in] float alpha1, [in] float alpha2);
  183.  
  184. [entry("PDF_rect"), helpstring("Draw a rectangle at lower left (x, y) with width and height"),]
  185. void PDF_rect([in] long p, [in] float x, [in] float y, [in] float width, [in] float height);
  186.  
  187. [entry("PDF_closepath"), helpstring("Close the current path"),]
  188. void PDF_closepath([in] long p);
  189.  
  190. [entry("PDF_stroke"), helpstring("Stroke the path with the current color and line width,and clear it"),]
  191. void PDF_stroke([in] long p);
  192.  
  193. [entry("PDF_closepath_stroke"), helpstring("Close the path, and stroke it"),]
  194. void PDF_closepath_stroke([in] long p);
  195.  
  196. [entry("PDF_fill"), helpstring("Fill the interior of the path with the current fill color"),]
  197. void PDF_fill([in] long p);
  198.  
  199. [entry("PDF_fill_stroke"), helpstring("Fill and stroke the path with the current fill and stroke color"),]
  200. void PDF_fill_stroke([in] long p);
  201.  
  202. [entry("PDF_closepath_fill_stroke"), helpstring("Close the path, fill, and stroke it"),]
  203. void PDF_closepath_fill_stroke([in] long p);
  204.  
  205. [entry("PDF_endpath"), helpstring("End the current path"),]
  206. void PDF_endpath([in] long p);
  207.  
  208. [entry("PDF_clip"), helpstring("Use the current path as clipping path"),]
  209. void PDF_clip([in] long p);
  210.  
  211. [entry("PDF_setgray_fill"), helpstring("Set the current fill color to a gray value between 0 and 1 inclusive"),]
  212. void PDF_setgray_fill([in] long p, [in] float g);
  213.  
  214. [entry("PDF_setgray_stroke"), helpstring("Set the current stroke color to a gray value between 0 and 1 inclusive"),]
  215. void PDF_setgray_stroke([in] long p, [in] float g);
  216.  
  217. [entry("PDF_setgray"), helpstring("Set the current fill and stroke color"),]
  218. void PDF_setgray([in] long p, [in] float g);
  219.  
  220. [entry("PDF_setrgbcolor_fill"), helpstring("Set the current fill color to the supplied RGB values"),]
  221. void PDF_setrgbcolor_fill([in] long p, [in] float red, [in] float green, [in] float blue);
  222.  
  223. [entry("PDF_setrgbcolor_stroke"), helpstring("Set the current stroke color to the supplied RGB values"),]
  224. void PDF_setrgbcolor_stroke([in] long p, [in] float red, [in] float green, [in] float blue);
  225.  
  226. [entry("PDF_setrgbcolor"), helpstring("Set the current fill and stroke color to the supplied RGB values"),]
  227. void PDF_setrgbcolor([in] long p, [in] float red, [in] float green, [in] float blue);
  228.  
  229. [entry("PDF_get_image_width"), helpstring("Return the width of an image"),]
  230. int PDF_get_image_width([in] long p, [in] int image);
  231.  
  232. [entry("PDF_get_image_height"), helpstring("Return the height of an image"),]
  233. int PDF_get_image_height([in] long p, [in] int image);
  234.  
  235. [entry("PDF_place_image"), helpstring("Place an image at the lower left corner (x, y), and scale it"),]
  236. void PDF_place_image([in] long p, [in] int image, [in] float x, [in] float y, [in] float scale);
  237.  
  238. [entry("PDF_open_image"), helpstring("Use image data from memory or file reference. Returns an image descriptor or -1"),]
  239. int PDF_open_image([in] long p, [in] LPCSTR type, [in] LPCSTR source, [in] LPCSTR data, [in] long len, [in] int width, [in] int height, [in] int components, [in] int bpc, [in] LPCSTR params);
  240.  
  241. [entry("PDF_open_JPEG"), helpstring("Open a JPEG image for later use. Returns an image descriptor or -1"),]
  242. int PDF_open_JPEG([in] long p, [in] LPCSTR filename);
  243.  
  244. [entry("PDF_open_TIFF"), helpstring("Open a TIFF image for later use. Returns an image descriptor or -1"),]
  245. int PDF_open_TIFF([in] long p, [in] LPCSTR filename);
  246.  
  247. [entry("PDF_open_GIF"), helpstring("Open a GIF image for later use. Returns an image descriptor or -1"),]
  248. int PDF_open_GIF([in] long p, [in] LPCSTR filename);
  249.  
  250. [entry("PDF_open_CCITT"), helpstring("Open a raw CCITT image for later use. Returns an image descriptor or -1"),]
  251. int PDF_open_CCITT([in] long p, [in] LPCSTR filename);
  252.  
  253. [entry("PDF_close_image"), helpstring("Close an image retrieved with one of the PDF_open_*() image functions. Usually not required, the image file will be closed anyway when the open function is done."),]
  254. void PDF_close_image([in] long p, [in] int image);
  255.  
  256. [entry("PDF_add_bookmark"), helpstring("Add a nested bookmark under parent, or a new top-level bookmark if level = 0. Returns a bookmark descriptor which may be used as parent for subesequent nested bookmarks"),]
  257. void PDF_add_bookmark([in] long p, [in] LPCSTR text, [in] int parent, [in] int open);
  258.  
  259. [entry("PDF_set_info"),    helpstring("Fill document information field key with value"),]
  260. long PDF_set_info ([in] long p, [in] LPCSTR key, [in] LPCSTR value);
  261.  
  262. [entry("PDF_attach_file"), helpstring("Add a file attachment annotation"),]
  263. void PDF_attach_file([in] long p, [in] float llx, [in] float lly, [in] float urx, [in] float ury, [in] LPCSTR filename, [in] LPCSTR description, [in] LPCSTR author, [in] LPCSTR mimetype, [in] LPCSTR icon);
  264.  
  265. [entry("PDF_add_note"), helpstring("Add a note annotation"),]
  266. void PDF_add_note([in] long p, [in] float llx, [in] float lly, [in] float urx, [in] float ury, [in] LPCSTR contents, [in] LPCSTR title, [in] LPCSTR icon, [in] int open);
  267.  
  268. [entry("PDF_add_pdflink"), helpstring("Add a file link annotation (to a PDF file)"),]
  269. void PDF_add_pdflink([in] long p, [in] float llx, [in] float lly, [in] float urx, [in] float ury, [in] LPCSTR filename, [in] int page, [in] LPCSTR dest);
  270.  
  271. [entry("PDF_add_launchlink"), helpstring("Add a launch annotation (arbitrary file type)"),]
  272. void PDF_add_launchlink([in] long p, [in] float llx, [in] float lly, [in] float urx, [in] float ury, [in] LPCSTR filename);
  273.  
  274. [entry("PDF_add_locallink"), helpstring("Add a link annotation with a target within the current file"),]
  275. void PDF_add_locallink([in] long p, [in] float llx, [in] float lly, [in] float urx, [in] float ury, [in] int page, [in] LPCSTR dest);
  276.  
  277. [entry("PDF_add_weblink"), helpstring("Add a weblink annotation"),]
  278. void PDF_add_weblink([in] long p, [in] float llx, [in] float lly, [in] float urx, [in] float ury, [in] LPCSTR url);
  279.  
  280. [entry("PDF_set_border_style"), helpstring("Set the border style for all kinds of annotations. These settings are used for all annotations until a new style is set"),]
  281. void PDF_set_border_style([in] long p, [in] LPCSTR style, [in] float width);
  282.  
  283. [entry("PDF_set_border_color"), helpstring("Set the border color for all kinds of annotations"),]
  284. void PDF_set_border_color([in] long p, [in] float red, [in] float green, [in] float blue);
  285.  
  286. [entry("PDF_set_border_dash"), helpstring("Set the border dash style for all kinds of annotations"),]
  287. void PDF_set_border_dash([in] long p, [in] float d1, [in] float d2);
  288.  
  289. }    // module
  290. }    // library
  291.